<template>
    <div class="cbox">
        <h4>子路由组件-查询参数</h4>
        <pre>{{ $route.query }}</pre>
        <input type="button" value="提示参数" @click="showQuery()">
    </div>
</template>

<!-- <script>
export default {
    methods:{
        showQuery(){
            alert( this.$route.query.argA + ":" + this.$route.query.argB )
        }
    },
    created(){
        console.log(this.$route.query)
    }
}
</script> -->
<script setup>

import { useRoute } from "vue-router";

const $route = useRoute();

function showQuery() {
    alert($route.query.argA + ":" + $route.query.argB)
}

console.log($route.query)

</script>

<style lang="scss" scoped>

</style>